package com.example.ffepeg.ffe;

import io.micrometer.common.util.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class TestAll {

    public static String formatted(int number){
        String result = "";
        String formatted = String.format(Locale.US, "%,d", number);
        int format = formatted.length();
        if (format == 1){
            result = "0,00" + formatted;
        }else if (format == 2){
            result = "0,0" + formatted;
        }else if (format == 3){
            result = "0," + formatted;
        }else {
           result = formatted;
        }
        return result;
    }

    public static void main(String[] args) {
        String formatted = formatted(11150);
        System.out.println(formatted);


        List<String> list  = new ArrayList<>();
        list.add("");list.add("1");list.add("");
        list.add("3");list.add("");list.add("5");

        List<Integer> list1  = new ArrayList<>();
        list1.add(1);
        list1.add(3);

        for (int i = 0; i < list.size(); i++) {
            if (StringUtils.isNotBlank(list.get(i))) {
                if (list1.contains(i)) {
                    System.out.println("存在的数据为: " + i);
                } else {
                    System.out.println("不存在的结果为: " + i);
                }
            }
        }
    }
}
